home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / windob10.zip / DEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1994-03-25  |  3KB  |  113 lines

  1. Program Jake;
  2. Uses WindObjs, Crt;
  3.  
  4. var
  5.   Main : PMain;
  6.   View3, View2, View : PView;
  7.   NewView : PView;
  8.   NewButton : PButton;
  9.   Button : PButton;
  10.   Button2 : PButton;
  11.   Button3 : PButton;
  12.   Text : PText;
  13.   Icon : PIcon;
  14.   CheckBox : PCheckBox;
  15.   Flags : ByteSet;
  16.   A : integer;
  17.  
  18. Procedure DoHalt; far;
  19. begin
  20.   TextMode(3);
  21.   Halt(0);
  22. end;
  23.  
  24. Procedure AddView; far;
  25. var
  26.   Icon2 : PIcon;
  27. begin
  28.   New(NewView, Init(50,50,200,100,'Hard Drive',TheFlags));
  29.   New(Icon2, Init('WindObjs.Ico',5,5,45,50,'Setup',donothing));
  30.   NewView^.Insert(Icon2);
  31.   Main^.Insert(NewView);
  32.   Main^.ToFront(Main^.NumDialogs);
  33.   Main^.DrawAll;
  34. end;
  35.  
  36. Procedure ShowFonts; far;
  37. var
  38.   Texts : PText;
  39.   NView : PView;
  40. begin
  41.   New(NView, Init(70,50,100,200,'Fonts',cmMove+CmClose));
  42.   New(Texts, Init(5,5,0,0,'Default',donothing));
  43.   NView^.Insert(Texts);
  44.   New(Texts,Init(5,10,0,0,'TripleX',donothing));
  45.   Texts^.Font := 1;
  46.   NView^.Insert(Texts);
  47.   New(Texts,Init(5,30,0,0,'Small',donothing));
  48.   Texts^.Font := 2;
  49.   Texts^.Size := 4;
  50.   NView^.Insert(Texts);
  51.   New(Texts,Init(5,35,0,0,'San Serif',donothing));
  52.   Texts^.Font := 3;
  53.   NView^.Insert(Texts);
  54.   New(Texts, Init(5,50,0,0,'Gothic',donothing));
  55.   Texts^.Font := 4;
  56.   NView^.Insert(Texts);
  57.   New(Texts, Init(5,62,0,0,'Script',donothing));
  58.   Texts^.Font := 5;
  59.   NView^.Insert(Texts);
  60.   New(Texts, Init(5,80,0,0,'Simple',donothing));
  61.   Texts^.font := 6;
  62.   NView^.Insert(Texts);
  63.   New(Texts, Init(5,100,0,0,'Italics',donothing));
  64.   Texts^.Font := 7;
  65.   NView^.Insert(texts);
  66.   New(Texts, Init(5,115,0,0,'Lite',donothing));
  67.   Texts^.Font := 8;
  68.   NView^.Insert(Texts);
  69.   New(Texts, Init(5,135,0,0,'Big',donothing));
  70.   Texts^.Font := 9;
  71.   NView^.Insert(Texts);
  72.   Main^.Insert(Nview);
  73.   Main^.ToFront(Main^.NumDialogs);
  74.   NView^.Paint;
  75. end;
  76.  
  77. begin
  78.   New(Main, Init);
  79.   New(CheckBox, Init(5,5,100,100,'CheckBox 1'));
  80.   New(View, Init(10,10,340,190,'Demo Window',TheFlags+cmScroll));
  81.   New(View2, Init(355,10,275,115,'Demo Window 2',TheFlags-CmSize));
  82.   New(View3, Init(10,205,450,190,'Demo Window 3',TheFlags));
  83.   New(Button, Init(5,5,100,15,'PUSH ME!',Donothing));
  84.   New(Button3, Init(5,25,100,15,'Do Nothing',Donothing));
  85.   New(Icon, Init('WindObjs.Ico',100,100,45,50,'Icon',Addview));
  86.   New(Text, Init(5,-2,Length('Text Example')*8,8,'Text Examples',donothing));
  87.   Text^.Font := 4;
  88.   Text^.Size := 2;
  89.   View2^.Insert(Text);
  90.   New(Text, Init(5,25,0,0,'   Different fonts and colors are',donothing));
  91.   View2^.Insert(Text);
  92.   New(Text, Init(5,35,0,0,'available through simple manipul-',donothing));
  93.   View2^.Insert(Text);
  94.   New(Text, Init(5,45,0,0,'ations.', donothing));
  95.   View2^.Insert(Text);
  96.   New(Button2, Init(90,75,100,15,'Show Fonts', ShowFonts));
  97.   View2^.Insert(Button2);
  98.   View^.Insert(Button);
  99.   View^.Insert(Button3);
  100.   View^.Insert(Icon);
  101.   View3^.Insert(CheckBox);
  102.   View^.Header := 20;
  103.   View^.Border := true;
  104.   Main^.Insert(View);
  105.   Main^.Insert(View2);
  106.   Main^.Insert(View3);
  107.   View^.InFront := True;
  108.   Main^.DrawAll;
  109.   Main^.Run;
  110.   Main^.Done;
  111.   TextMode(3);
  112. end.
  113.